package com.welike.shibo.enums;

import lombok.Getter;

/**
 * 异常信息枚举类
 * @author fangyu
 * @date 2019-07-23
 */
@Getter
public enum ResultEnum {

    SUCCESS(0, "成功"),

    TOKEN_INVALID(1001, "token无效"),

    TOKEN_EXPIRED(1002, "token已过期"),

    PARAM_ERROR(1003, "请求参数错误"),

    LOGIN_ERROR(1004, "登录失败, 请重新登录!"),

    NOT_LOGIN(1005, "未登录, 请先登录!"),

    PHONE_DONT_NOT_NULL(1006, "手机号码不可为空"),

    PHONE_REGISTER(1007, "手机号码已注册"),

    PHONE_ERROR(1008, "手机号码异常"),

    CAPTCHA_ERROR(1009, "验证码错误"),

    REGISTER_ERROR(1010, "注册失败"),

    PASSWORD_DONT_NOT_NULL(1011, "密码不可为空"),

    PASSWORD_TOO_SHORT(1021, "密码过短"),

    PASSWORD_ERROR(1012, "密码错误"),

    USER_NOT_EXIST(1013, "用户未注册"),  //

//    ACCOUNT_IS_DISABLE(1014, "账号已被禁用!请联系管理员解禁!"),

    VIDEO_NOT_EXIST(1014, "视频不存在"),

    COMMENT_NOT_EXIST(1015, "评论不存在"),

    GOODS_NOT_EXIST(1016, "商品不存在(数据来源于简单购购)"),

    GOODS_EXIST(1016, "商品已存在"),

    // 后台
    USERNAME_PASSWORD_IS_EMPTY(2001, "账号和密码不可为空"),

    E_2002(2002, "账号已存在"),

    USERNAME_PASSWORD_ERROR(2002, "账号或密码错误"),

    MODIFY_FAIL(2003, "修改失败"),

    SYSTEM_ERROR(400, "系统错误"),

    E_400(400, "请求处理异常，请稍后再试"),

    NOT_FOUND(404, "资源不存在"),

    E_500(500, "请求方式有误,请检查 GET/POST"),

    E_502(502, "权限不足, 请联系超级管理员"),

    E_10008(10008, "角色删除失败,尚有用户属于此角色"),

    E_20011(20011, "登陆已过期,请重新登陆"),

    E_90003(90003, "缺少必填参数"),

    E_90004(90004, "参数超长，请注意提交参数");


    private Integer code;

    private String msg;

    ResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
